package com.loan.mappers;

import com.loan.entity.Perm;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface RolePermMapper{

    /**
     * 根据角色id，权限id 添加到角色权限中间表
     * @param roleid
     * @param permid
     */
    @Insert("insert into role_perm(role_id,perm_id) values(#{roleid},#{permid})")
    public void add(@Param("roleid") int roleid,@Param("permid") int permid);

    /**
     * 根据角色的id删除角色权限中间表
     * @param roleid
     */
    @Delete("delete from role_perm where role_id=#{roleid}")
    public void delByRoleId(int roleid);


}
